********************************************************************************
* NO BETTER TIME THAN NOW                                                      *
* FUTURE UNCERTAINTY AND PRIVATE INVESTMENT UNDER DICTATORSHIP                 *
*                                                                              *
* ALBERTUS AND GAY (2018)                                                      *
*                                                                              *
* ACCEPTED AT ECONOMICS & POLITICS                                             *
********************************************************************************

*****************
* Program Setup *
*****************

version 15
clear all
set more off
set linesize 255

***********
* Globals *
***********

cd ""

***********
* TABLE 1 *
***********

* Import data

use AMplusInvestment_WB.dta, clear
drop wbcodeyear-wbcodehabmen

* Calculate new private domestic investment variable as % of GDP

gen privatedominvest_gdp = grossfixedcapform_private_gdp - fdi_gdp
gen privatedominvest_gdp_adj = privatedominvest_gdp
replace privatedominvest_gdp_adj = 0 if                                      ///
	    fdi_gdp > grossfixedcapform_private_gdp & fdi_gdp!=.

* Figure 1a

twoway (kdensity privatedominvest_gdp_adj if                                 ///
		regime==0 & privatedominvest_gdp_adj>0)                              ///
	   (kdensity privatedominvest_gdp_adj if                                 ///
	    regime==1&privatedominvest_gdp_adj>0, color(gray) lpattern(dash)) if ///
		privatedominvest_gdp_adj<50,                                         ///
	   legend(label(1 "Dictatorship") label(2 "Democracy"))                  ///
	   xtitle("Private Domestic Investment/GDP") ytitle("Density")           ///
	   graphregion(fcolor(white))

* Figure 1b

twoway (kdensity privatedominvest_gdp_adj if                                 ///
	   (closed==2|lparty==2|sparty==1|monarch==1)&regime==0)                 ///
	   (kdensity privatedominvest_gdp_adj if                                 ///
	   (closed==0|closed==1) & (lparty==0|lparty==1) & sparty==0&monarch==0& ///
	    regime==0&privatedominvest_gdp_adj>0,                                ///
		color(gray) lpattern(dash)) if                                       ///
		privatedominvest_gdp_adj<50,                                         ///
		legend(label(1 "Constraints") label(2 "No Constraints"))             ///
		xtitle("Private Domestic Investment/GDP") ytitle("Density")          ///
		graphregion(fcolor(white))

